package com.feibo.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @Description:
 * @Author: zhenglinyong
 * @CreateDate: 2018/12/28 10:41 PM
 **/
@Component
public class RedisUtils {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    public void set(final String key, final String value) {
        stringRedisTemplate.opsForValue().set(key, value);
    }

    public String get(final String key) {
        String result = stringRedisTemplate.opsForValue().get(key);
        return result;
    }
}
